package com.order.Client;

import com.order.Client.impl.StorageImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import spring.cloud.Utils.R;

/**
 * @author cyt
 * @create 2020-06-07 17:33
 */
@Component
@FeignClient(name = "seata-storage", fallback = StorageImpl.class)
public interface StorageClient {
    /**
     * 远程调用
     * @param productId
     * @param count
     * @return
     */
    @RequestMapping("/storage/dec/{productId}/{count}")
    public R decStorage(@PathVariable("productId") Integer productId, @PathVariable("count") Integer count);
}
